package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.Member;
import com.ruoyi.system.mapper.MemberMapper;
import com.ruoyi.system.service.IMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Ly lilongfei
 * @date 2024/8/22
 * @Description
 */
@Service
public class MemberService implements IMemberService {

    @Autowired
    private MemberMapper memberMapper;

    @Override
    public int getMemberId(String athleteName) {
        Integer memberId = memberMapper.getMemberIdbyAthleteName(athleteName);
        if (memberId == null) {
            throw new RuntimeException("运动员不存在");
        }
        return memberId;
    }
    @Override
    public Member selectMemberById(String id) {
        System.out.println(memberMapper.getMemberById(id));
        return memberMapper.getMemberById(id);
    }
}
